10 N = 9
20 FOR I = 1 TO N
30 READ X(I)
40 NEXT I
50 FOR P = 2 TO N
60   T = X(P)
70   FOR J = P TO 1 STEP -1
80     IF X(J - 1) <= T THEN 110
90     X(J) = X(J - 1)
100  NEXT J
110  X(J) = T
115  GOSUB 125
120 NEXT P
121 GOTO 180
125 REM PRINT ARRAYS
130 FOR I = 1 TO N
140   PRINT X(I);
150 NEXT I
160 PRINT
165 RETURN
170 DATA 3,1,4,1,5,9,2,6,5
180 END